package cj.web.kly.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cj.web.kly.dao.SpecialistLabelDAO;
import cj.web.kly.domain.SpecialistLabel;

@Service
public class SpecialistLabelService {

	@Autowired
    private SpecialistLabelDAO specialistLabelDAO;
	
	public List<SpecialistLabel> queryAll(){
		return specialistLabelDAO.queryAll();
	}
	
	/**
	 * 查询
	 * @param specialistLabel
	 * @return specialistLabellis;size
	 */
	public Map query(SpecialistLabel specialistLabel){
		Map rep = new HashMap();
		List<SpecialistLabel> categorylis = specialistLabelDAO.query(specialistLabel);
		int size = specialistLabelDAO.querySize(specialistLabel); 
		rep.put("specialistLabellis", categorylis);
		rep.put("size", size);
		return rep;
    }
	
	public SpecialistLabel queryById(int id){
		SpecialistLabel obj = specialistLabelDAO.queryById(id);
		return obj;
    }
	
	public void create(SpecialistLabel specialistLabel){
		specialistLabelDAO.create(specialistLabel);
	}
	
	public void update(SpecialistLabel specialistLabel){
		specialistLabelDAO.update(specialistLabel);
	}
	
	public void deleteById(int id){
		specialistLabelDAO.deleteById(id);
	}
}
